﻿using System;
using System.ComponentModel.DataAnnotations;
using Data.AggregateRoot;

namespace Data.Entities
{
    /// <summary>
    /// 系统组织架构
    /// </summary>
    public class SysOrganization : EntityBase
    {
        /// <summary>
        /// 编号
        /// </summary>
        [StringLength(200)]
        [Required]
        public string Code { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        [StringLength(200)]
        [Required]
        public string Name { get; set; }

        /// <summary>
        /// 父级Id
        /// </summary>
        [Required]
        public Guid ParentId { get; set; } = Guid.Empty;
        /// <summary>
        /// 描述
        /// </summary>
        [StringLength(2000)]
        public string Description { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }
        /// <summary>
        /// 部门Id
        /// </summary>
        [Required]
        public Guid DepartmentId { get; set; }
    }
}